<html>
<head><meta charset="utf-8"><title>Refactor types to fit the chalk-ty generic plan · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html">Refactor types to fit the chalk-ty generic plan</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="206283495"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/206283495" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#206283495">(Aug 07 2020 at 17:10)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I've done a litte bit of experimentation to try to understand how interning works today in rustc and what the refractoring would look like. I have written this (without checking it compiles, just to get a sense of how everything should come together):</p>
<div class="codehilite"><pre><span></span><code><span class="c1">// Types are still interned in a `ShardedHashMap&lt;Interned&lt;&#39;tcx, TyS&gt;, ()&gt;`,</span>
<span class="c1">// where `TyKind&lt;TyCtxt&lt;&#39;tcx&gt;&gt;: Borrow&lt;Interned&lt;&#39;tcx, TyS&gt;&gt;`</span>

<span class="k">impl</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="w"> </span><span class="n">CtxtInterners</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">fn</span> <span class="nf">intern_ty</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">kind</span>: <span class="nc">TyKind</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">Ty</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="kd">let</span><span class="w"> </span><span class="n">interned</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">self</span><span class="p">.</span><span class="n">type_</span><span class="w"></span>
<span class="w">            </span><span class="c1">// This is unchanged...</span>
<span class="w">            </span><span class="p">.</span><span class="n">intern</span><span class="p">(</span><span class="n">kind</span><span class="p">,</span><span class="w"> </span><span class="o">|</span><span class="n">kind</span><span class="o">|</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                </span><span class="kd">let</span><span class="w"> </span><span class="n">flags</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="k">super</span>::<span class="n">flags</span>::<span class="n">FlagComputation</span>::<span class="n">for_kind</span><span class="p">(</span><span class="o">&amp;</span><span class="n">kind</span><span class="p">);</span><span class="w"></span>

<span class="w">                </span><span class="kd">let</span><span class="w"> </span><span class="n">ty_struct</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">TyS</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">                    </span><span class="n">kind</span><span class="p">,</span><span class="w"></span>
<span class="w">                    </span><span class="n">flags</span>: <span class="nc">flags</span><span class="p">.</span><span class="n">flags</span><span class="p">,</span><span class="w"></span>
<span class="w">                    </span><span class="n">outer_exclusive_binder</span>: <span class="nc">flags</span><span class="p">.</span><span class="n">outer_exclusive_binder</span><span class="p">,</span><span class="w"></span>
<span class="w">                </span><span class="p">};</span><span class="w"></span>

<span class="w">                </span><span class="n">Interned</span><span class="p">(</span><span class="bp">self</span><span class="p">.</span><span class="n">arena</span><span class="p">.</span><span class="n">alloc</span><span class="p">(</span><span class="n">ty_struct</span><span class="p">))</span><span class="w"></span>
<span class="w">            </span><span class="p">})</span><span class="w"></span>
<span class="w">            </span><span class="p">.</span><span class="mf">0.</span><span class="n">kind</span><span class="p">;</span><span class="w"></span>
<span class="w">        </span><span class="c1">// ...the only difference is that we wrap the result in a `Ty&lt;TyCtxt&lt;&#39;tcx&gt;&gt;`</span>
<span class="w">        </span><span class="n">Ty</span><span class="w"> </span><span class="p">{</span><span class="w"> </span><span class="n">interned</span><span class="w"> </span><span class="p">}</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">impl</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="w"> </span><span class="n">TypeInterner</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">TyCtxt</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">InternedType</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="na">&#39;tcx</span><span class="w"> </span><span class="n">TyKind</span><span class="o">&lt;</span><span class="bp">Self</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>

<span class="w">    </span><span class="k">fn</span> <span class="nf">intern_ty</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">kind</span>: <span class="nc">TyKind</span><span class="o">&lt;</span><span class="bp">Self</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="n">_flags</span>: <span class="nc">TyFlags</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kp">&amp;</span><span class="na">&#39;tcx</span><span class="w"> </span><span class="n">TyKind</span><span class="o">&lt;</span><span class="bp">Self</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="bp">self</span><span class="p">.</span><span class="n">mk_ty</span><span class="p">(</span><span class="n">kind</span><span class="p">)</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>

<span class="w">    </span><span class="k">fn</span> <span class="nf">lookup_ty_kind</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">ty</span>: <span class="kp">&amp;</span><span class="na">&#39;tcx</span><span class="w"> </span><span class="n">TyKind</span><span class="o">&lt;</span><span class="bp">Self</span><span class="o">&gt;</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kp">&amp;</span><span class="na">&#39;tcx</span><span class="w"> </span><span class="n">TyKind</span><span class="o">&lt;</span><span class="bp">Self</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="o">&amp;</span><span class="bp">self</span><span class="p">.</span><span class="n">interners</span><span class="p">.</span><span class="n">type_</span><span class="p">.</span><span class="n">get</span><span class="p">(</span><span class="n">ty</span><span class="p">).</span><span class="n">unwrap</span><span class="p">().</span><span class="n">kind</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>

<span class="w">    </span><span class="k">fn</span> <span class="nf">lookup_ty_flags</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">ty</span>: <span class="kp">&amp;</span><span class="na">&#39;tcx</span><span class="w"> </span><span class="n">TyKind</span><span class="o">&lt;</span><span class="bp">Self</span><span class="o">&gt;</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">TypeFlags</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="bp">self</span><span class="p">.</span><span class="n">interners</span><span class="p">.</span><span class="n">type_</span><span class="p">.</span><span class="n">get</span><span class="p">(</span><span class="n">ty</span><span class="p">).</span><span class="n">unwrap</span><span class="p">().</span><span class="n">flags</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">pub</span><span class="w"> </span><span class="k">struct</span> <span class="nc">Ty</span><span class="o">&lt;</span><span class="n">I</span>: <span class="nc">TypeInterner</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">interned</span>: <span class="nc">I</span>::<span class="n">InternedType</span><span class="p">,</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">impl</span><span class="o">&lt;</span><span class="n">I</span>: <span class="nc">TypeInterner</span><span class="o">&gt;</span><span class="w"> </span><span class="n">Ty</span><span class="o">&lt;</span><span class="n">I</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">kind</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">interner</span>: <span class="kp">&amp;</span><span class="nc">I</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kp">&amp;</span><span class="nc">TyKind</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="n">interner</span><span class="p">.</span><span class="n">lookup_ty_kind</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">.</span><span class="n">interned</span><span class="p">)</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>

<span class="w">    </span><span class="k">pub</span><span class="w"> </span><span class="k">fn</span> <span class="nf">flags</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">interner</span>: <span class="kp">&amp;</span><span class="nc">I</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="nc">TyFlags</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">        </span><span class="n">interner</span><span class="p">.</span><span class="n">lookup_ty_flags</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">.</span><span class="n">interned</span><span class="p">)</span><span class="w"></span>
<span class="w">    </span><span class="p">}</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>


<p>Does it look like what you'd expect? Did I understand the design correctly?<br>
In particular, what I wrote would mean that in rustc, <code>Ty&lt;TyCtxt&gt;</code> contains an interned <code>&amp;'tcx TyKind&lt;_&gt;</code>, but we would still need to look it up in the interner to get a <code>TyKind</code>? Or should I return the parameter directly:</p>
<div class="codehilite"><pre><span></span><code><span class="k">fn</span> <span class="nf">lookup_ty_kind</span><span class="p">(</span><span class="o">&amp;</span><span class="bp">self</span><span class="p">,</span><span class="w"> </span><span class="n">ty</span>: <span class="kp">&amp;</span><span class="na">&#39;tcx</span><span class="w"> </span><span class="n">TyKind</span><span class="o">&lt;</span><span class="bp">Self</span><span class="o">&gt;</span><span class="p">)</span><span class="w"> </span>-&gt; <span class="kp">&amp;</span><span class="na">&#39;tcx</span><span class="w"> </span><span class="n">TyKind</span><span class="o">&lt;</span><span class="bp">Self</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="n">ty</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>


<p>(Also I hope I don't bother you too much <span aria-label="see no evil" class="emoji emoji-1f648" role="img" title="see no evil">:see_no_evil:</span>)</p>



<a name="207024284"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207024284" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207024284">(Aug 15 2020 at 14:31)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> You probably have more important stuff to do, but I just wanted to be sure you saw my message <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span></p>



<a name="207040126"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207040126" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207040126">(Aug 15 2020 at 21:27)</a>:</h4>
<p>Being able to just return the parameter directly looks suspicious</p>



<a name="207040202"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207040202" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207040202">(Aug 15 2020 at 21:29)</a>:</h4>
<p>Like, that would work regardless of the TypeInterner impl, right? Then <code>lookup_ty_kind</code> wouldn't even be needed</p>



<a name="207508542"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207508542" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207508542">(Aug 20 2020 at 10:32)</a>:</h4>
<p><span class="user-mention" data-user-id="255061">@LeSeulArtichaut</span> man i'm glad you've been pushing on this and I apologize for being so afk</p>



<a name="207508547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207508547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207508547">(Aug 20 2020 at 10:32)</a>:</h4>
<p>slowly, <em>slowly</em> catching back up</p>



<a name="207508781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207508781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207508781">(Aug 20 2020 at 10:36)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan/near/207508542">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="255061">LeSeulArtichaut</span> man i'm glad you've been pushing on this and I apologize for being so afk</p>
</blockquote>
<p>Sorry for pinging you twice, I didn't know if you didn't have time or if you missed my message for whatever reason</p>



<a name="207508797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207508797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207508797">(Aug 20 2020 at 10:36)</a>:</h4>
<p><span class="user-mention" data-user-id="255061">@LeSeulArtichaut</span> well I think that in the compiler <em>today</em> we have <code>Ty&lt;'tcx&gt;</code> which is (iirc) a <code>&amp;'tcx TyS&lt;'tcx&gt;</code> or something like that, right?</p>



<a name="207508808"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207508808" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207508808">(Aug 20 2020 at 10:36)</a>:</h4>
<p>yeah, no worries</p>



<a name="207508824"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207508824" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207508824">(Aug 20 2020 at 10:36)</a>:</h4>
<p>Opening the docs <span aria-label="upside down" class="emoji emoji-1f643" role="img" title="upside down">:upside_down:</span></p>



<a name="207508828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207508828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207508828">(Aug 20 2020 at 10:36)</a>:</h4>
<p>it's always very busy and this week and last a bit more so than most :)</p>



<a name="207508833"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207508833" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207508833">(Aug 20 2020 at 10:36)</a>:</h4>
<p>(plus other things)</p>



<a name="207508839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207508839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207508839">(Aug 20 2020 at 10:37)</a>:</h4>
<div class="codehilite"><pre><span></span><code><span class="k">type</span> <span class="nc">Ty</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;</span><span class="na">&#39;tcx</span><span class="w"> </span><span class="n">TyS</span><span class="o">&lt;</span><span class="na">&#39;tcx</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
</code></pre></div>



<a name="207508872"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207508872" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207508872">(Aug 20 2020 at 10:37)</a>:</h4>
<p>/me thinks</p>



<a name="207508992"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207508992" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207508992">(Aug 20 2020 at 10:39)</a>:</h4>
<p>I'm trying to remember what I expected but one thing I might imagine is that <code>InternedTy</code> becomes <code>TyS&lt;'tcx&gt;</code></p>



<a name="207509071"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207509071" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207509071">(Aug 20 2020 at 10:40)</a>:</h4>
<p>ah right and I think <code>Ty&lt;'tcx&gt;</code> was going to be an alias for <code>chalk_ty::Ty&lt;TyCtxt&lt;'tcx&gt;&gt;</code> or something like that</p>



<a name="207509079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207509079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207509079">(Aug 20 2020 at 10:40)</a>:</h4>
<p>anyway I don't know what the best step-by-step items are in the list</p>



<a name="207509083"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207509083" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207509083">(Aug 20 2020 at 10:40)</a>:</h4>
<p>I have to catch up with whatever MCP discussion has (or hasn't) taken place</p>



<a name="207509105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207509105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207509105">(Aug 20 2020 at 10:41)</a>:</h4>
<p>I think there was a parallel thread in <a class="stream" data-stream-id="144729" href="/#narrow/stream/144729-wg-traits">#wg-traits</a> (<a href="#narrow/stream/144729-wg-traits/topic/Type.20library">here</a>)</p>



<a name="207550148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/Refactor%20types%20to%20fit%20the%20chalk-ty%20generic%20plan/near/207550148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/Refactor.20types.20to.20fit.20the.20chalk-ty.20generic.20plan.html#207550148">(Aug 20 2020 at 17:27)</a>:</h4>
<blockquote>
<p>I'm trying to remember what I expected but one thing I might imagine is that <code>InternedTy</code> becomes <code>TyS&lt;'tcx&gt;</code></p>
</blockquote>
<p>What I’m still failing to understand is, if the interned type is <code>TyS</code>, why do we need <code>ty.kind()</code> to take the <code>TyCtxt</code> as a parameter? Is it just to allow for generic interning strategies?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>